package com.class5.springboot.frame.logger;

import com.class5.springboot.frame.repo.entity.SuperEntity;

import java.io.Serializable;
import java.sql.Timestamp;

/**
 * base_login_logger 登录日志
 **/
@SuppressWarnings("serial")
public class BaseLoginLogger extends SuperEntity implements Serializable {

    /**主键(id)*/
    private Long id;

    /**用户ID(user_id)*/
    private Long userId;

    /**机构ID(org_id)*/
    private Long orgId;

    /**登录IP(ip)*/
    private String ip;

    /**创建时间(create_time)*/
    private Timestamp createTime;

    /**更新时间(modify_time)*/
    private Timestamp modifyTime;

    public BaseLoginLogger() {
    }

    public BaseLoginLogger(Long id, Long userId, Long orgId) {
        this.id = id;
        this.userId = userId;
        this.orgId = orgId;
    }

    public Long getId() {
        return id;
    }

    public BaseLoginLogger setId(Long id) {
        addOriginalData("id", this.id, id);
        this.id = id;
        return this;
    }

    public Long getUserId() {
        return userId;
    }

    public BaseLoginLogger setUserId(Long userId) {
        addOriginalData("user_id", this.userId, userId);
        this.userId = userId;
        return this;
    }

    public Long getOrgId() {
        return orgId;
    }

    public BaseLoginLogger setOrgId(Long orgId) {
        addOriginalData("org_id", this.orgId, orgId);
        this.orgId = orgId;
        return this;
    }

    public String getIp() {
        return ip;
    }

    public BaseLoginLogger setIp(String ip) {
        addOriginalData("ip", this.ip, ip);
        this.ip = ip;
        return this;
    }

    public Timestamp getCreateTime() {
        return createTime;
    }

    public BaseLoginLogger setCreateTime(Timestamp createTime) {
        addOriginalData("create_time", this.createTime, createTime);
        this.createTime = createTime;
        return this;
    }

    public Timestamp getModifyTime() {
        return modifyTime;
    }

    public BaseLoginLogger setModifyTime(Timestamp modifyTime) {
        addOriginalData("modify_time", this.modifyTime, modifyTime);
        this.modifyTime = modifyTime;
        return this;
    }

    @Override()
    public String toString() {
        return this.getClass().getName() + ":{id:" + id + ",userId:" + userId + ",orgId:" + orgId + ",ip:" + ip + ",createTime:" + createTime + ",modifyTime:" + modifyTime + "}";
    }

    @Override()
    public boolean equals(Object arg0) {
        return ((BaseLoginLogger) arg0).getId().equals(id);
    }

    @Override()
    public int hashCode() {
        return id == null ? 0 : id.hashCode();
    }
}